#!/usr/bin/python3
from math import sqrt


def prime_number(numbers):
    if numbers < 2:
        return False
    for i in range(2, int(sqrt(numbers))+1):
        if 0 == numbers % i:
            return False

    return True


def pmd(number):
    if not prime_number(number):
        return False
    l = len(str(number))
    for i in range(l):
        nn = str(number)[i, l] + str(number)[0, i]



try:
    t = int(input())
    for x in range(t):
        n = int(input())
        if prime_number(n):
            print("NO")
        else:
            if find2prime_mult(n):
                print("YES")
            else:
                print("NO")

except ValueError:
    pass
except EOFError:
    pass
except MemoryError:
    pass
